#pragma once


class rtp_mgr
{
public:
	rtp_mgr(void);
	~rtp_mgr(void);
public:
	bool init_rtp_mgr(unsigned short vport,unsigned short aport);
	bool start_thread(void *lp_rtp_data_mgr);
	bool add_dest_addr(string ip,unsigned short aport,unsigned short vport);
	bool send_audio_data(unsigned char *pdata,int datalen);
	bool send_video_data(unsigned char *pdata,int datalen);
	bool reset_video_dest();
	bool reset_audio_dest();
	bool stop_thread();
private:
	static DWORD WINAPI audio_thread(LPVOID lp);
	static DWORD WINAPI	video_thread(LPVOID lp);
	unsigned short	m_self_audio_port;
	unsigned short	m_self_video_port;
	bool			m_brun;
	HANDLE			m_video_play_thread;
	HANDLE			m_audio_play_thread;

	bool			m_run;
	unsigned short	m_remote_audio_port;
	unsigned short	m_remote_video_port;
	string			m_remote_ip;

};


